<%@ page import="pro.ccy.pojo.Goods" %>
<%@ page import="pro.ccy.JdbcUtils" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String id = request.getParameter("id");
    Goods goods = null;
    if (id!=null){
        String sql = "SELECT id,`name`,price FROM `goods` WHERE id = ?";
        goods = JdbcUtils.select(sql, Goods.class,id);
    }else {
        goods = new Goods();
        goods.setName("");
        goods.setPrice(null);
    }

%>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java实训团队协作简单案例 - 商品信息编辑页面</title>
    <link rel="shortcut icon" href="assets/img/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="assets/vendors/font-awesome-4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="assets/css/core.css" />
    <link rel="stylesheet" href="assets/css/index.css" />

    <link rel="stylesheet" href="assets/css/goods.css" />
</head>

<body>
    <jsp:include page="/WEB-INF/tpl/syg/header.jsp"/>

    <section class="container">
        <jsp:include page="/WEB-INF/tpl/syg/left.jsp"/>
        <div class="main-right">
            <h3>商品信息编辑页面</h3>
<<<<<<< HEAD:web/ccy/goods-edit.jsp
            <form action="/ccysave" method="post" enctype="multipart/form-data">
                名称:<input name="n" type="text" value="<%=goods.getName()%>"/>
                单价:<input name="p" type="number" value="<%=goods.getPrice()%>"/>
                图片：<input name="i" type="file" value="<%=goods.getImage()%>"/>

=======
            <form action="/syggoods/save" method="post" enctype="multipart/form-data">
                名称：<input name="n" type="text" />
                单价：<input name="p" type="number" />
                图片：<input name="i" type="file" />
>>>>>>> 85187eec3314a1566584f1dfe608166ad15c6841:web/syg/goods-edit.jsp
                <button>保存</button>
                <input type="hidden" name="id" value="<%=goods.getId()%>">
            </form>
        </div>
    </section>
</body>

</html>